<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$admin_title}</title>
<include file="./core/Modules/Center/Tpl/Public/js_css_header.html" />
<style type="text/css">
.current_step{font-size: 18px;font-weight: bold;color:orange;}
</style>
<script type="text/javascript">
	function download(){
		$("#status").html("正在执行下载，请勿关闭页面....");
		$.post("__APP__/center/upgrade/download_process/", function(result){
			if(result.status == 0){
				alert(result.msg);
			}else{
				$("#status").html("升级补丁&nbsp;<strong style='color:orange;'>下载完成</strong>，正跳转第二步！");
				setTimeout(function(){
					redirectURL("__APP__/center/upgrade/?step=2");
				},800);
			}
		},"JSON");
	}
	function upgrade(){
		$("#status").html("正在执行升级，请勿关闭页面....");
		$.post("__APP__/center/upgrade/upgrade_process/", function(result){
			if(result.status == 0){
				alert(result.msg);
			}else{
				$("#status").html("<strong style='color:orange;'>恭喜升级完成！</strong>");
				setTimeout(function(){
					redirectURL("__APP__/center/frame/index/");
				},800);
			}
		},"JSON");
	}
</script>
</head>
<body>
	<include file="./core/Modules/Center/Tpl/Public/header.html" />
	<div class="cont_wrap">
		<div class="position">当前位置:&nbsp;{$location}&nbsp;&gt;&nbsp;系统升级</div>
		<table width="100%" cellpadding="0" cellspacing="0" class="line">
			<tr height="20">
				<td align="center" width="18%" class="tabl_line_bg">更新状态</td>
				<td align="left">
					<span style="color:gray;"><span <if condition='$step eq 1'>class="current_step"</if>>第1步：下载升级补丁</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span <if condition='$step eq 2'>class="current_step"</if>>第2步：更新系统程序</span></span>
				</td>
			</tr>
			<tr height="20">
				<td align="center" class="tabl_line_bg">执行情况</td>
				<td align="left">
					<span id="status"></span>
				</td>
			</tr>
			<tr height="20">
				<td align="center" class="tabl_line_bg">操作</td>
				<td align="left">
					<input type="button" name="dl" value=" 返回 " onclick="redirectURL('__APP__/center/frame/index/')"/>&nbsp;&nbsp;
					<if condition='$step eq 1'>
						<input type="button" name="dl" value=" 开始下载 " onclick="download()"/>
					<else/>
						<input type="button" name="up" value=" 立即升级 " onclick="upgrade()"/>
					</if>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>
